<!DOCTYPE html>
<html lang="en">
<head>
     <!-- Bootstrap core CSS -->
     <link href="template/assets/css/bootstrap.css" rel="stylesheet">
     <!--link href="template/plugins/dialog/dist/ui-dialog.css" rel="stylesheet"-->
     <link href="template/assets/css/style.css" rel="stylesheet">
     <!--external css-->
     <!--link href="template/assets/font-awesome/css/font-awesome.css" rel="stylesheet" /-->
     <!--link rel="stylesheet" type="text/css" href="template/assets/css/zabuto_calendar.css"-->
     <!--link rel="stylesheet" type="text/css" href="template/assets/js/gritter/css/jquery.gritter.css" /-->
     <!--link rel="stylesheet" type="text/css" href="template/assets/lineicons/style.css"-->
    
     <!-- Custom styles for this template -->
     
     <!--link href="template/assets/css/style-responsive.css" rel="stylesheet"-->
     <script src="template/assets/js/jquery.js"></script>
     <script type="text/javascript" src="template/assets/js/jquery-1.8.3.min.js"></script>
     <script type="text/javascript" src="template/assets/js/bootstrap.min.js"></script>
 </head>
<body>
<div class="form-group">
    <form id='form' name="form" class="form-horizontal style-form">
        <input type="hidden" name="id" value="{{ id_zone }}">
        <div class="form-group">
            <label class="col-sm-2 col-sm-2 text-center" > 所属国家 </label>
            <div class="col-sm-10">
                <select name="id_country" class="form-control">
                    {% for i in country %}
                       <option value="{{ i.id_country }}" {% if i.id_country == id_country  %} selected {% endif %}> {{ i.title }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 col-sm-2 text-center" > 区域（中文） </label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="title" value="{{ title }}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 col-sm-2 text-center" > 区域（当地） </label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="lang" value="{{ lang }}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 col-sm-2 text-center" > 地区编码 </label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="code" value="{{ code }}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 col-sm-2 text-center" > 货币 </label>
            <div class="col-sm-10">
                <select name="currency_id" class="form-control">
                    {% for i in currency %}
                        <option value="{{ i.currency_id }}" {% if i.currency_id == currency_id  %} selected {% endif %}> {{ i.currency_title }}--{{ i.currency_code }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-10 text-center">
                <button type="button" class="btn btn-info col-sm-10 save"> 保 存 </button>
            </div>
        </div>
    </form>
</div>
<script>
   $(".save").click(function () {
       var url ='country.php?&act=save';
       var data = $("#form").serialize();
       $.post(url,data).success(function (data) {
          var ret = JSON.parse(data) ;
          if(!ret.ret)
          {
             alert(ret.msg);
          }
          else{
              window.parent.ModalClose();
          }
       })

   })


</script>
</body>

</html>

